package net.lzzy.controller;

import net.lzzy.entity.Article;
import net.lzzy.service.ArticleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping
public class ApiArticleController {
    @Autowired
    private ArticleService articleService;
    @GetMapping("/{id}")
    public Article findArticle(@PathVariable("id") Integer id){
        return articleService.findArticleById(id);
    }


//    @GetMapping("/{id}/{content}")
//    public void updateArticle(@PathVariable("id") Integer id, @PathVariable("content") String content){
//        articleService.updateArticle(id, content);
//    }
//    @GetMapping("/delete/{id}")
//    public void deleteArticle(@PathVariable("id") Integer id) {
//        articleService.deleteArticleById(id);
//    }
}
